<template>
  <Card
    :tab-list="tabListTitle"
    v-bind="$attrs"
    :active-tab-key="activeKey"
    @tab-change="onTabChange"
  >
    <p v-if="activeKey === 'tab1'">
      <VisitAnalysis :list="list" :xyTitle="xyTitle" />
    </p>
  </Card>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import { Card } from 'ant-design-vue';
  import VisitAnalysis from './VisitAnalysis.vue';

  const activeKey = ref('tab1');
  defineProps({
    list: {
      type: Array,
      default: () => [],
    },
    tabListTitle: {
      type: Array,
      default: () => [],
    },
    xyTitle: {
      type: Object,
      default: () => {},
    },
  });

  function onTabChange(key) {
    activeKey.value = key;
  }
</script>
